package com.demo.study.service.impl;

import com.demo.study.dto.UserMapper;
import com.demo.study.entity.User;
import com.demo.study.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author sz
 * @version V1.0
 * @date 2023/12/24 17:44
 * @Description: 多敲代码
 */
@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUserInfoById(String userId) {
        try {
            Thread.sleep(1000);
            if ("1".equals(userId)){
                Thread.sleep(100000);
            }
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        System.out.println("userId:"+userId);

        return userMapper.getUserInfoById(userId);
    }
}
